<template>
  <div class="page-container" v-loading="loading" v-loadingCommonStyle>
    <ex_header_spiler :title="$tt('label_base_info')" />

    <ex_super_desc v-bind="baseOption" :data="form" :attrs="$defaultDetailDescAttrs">
    </ex_super_desc>
    <ex_header_spiler :title="$tt('label_transport_info')" />
    <ex_super_desc v-bind="logisticsOption" :data="form" :attrs="$defaultDetailDescAttrs" />
    <ex_header_spiler :title="$tt('label_value_add_service')" />
    <ex_super_desc v-bind="serviceOption" :data="form" :attrs="$defaultDetailDescAttrs" />
    <template v-if="form.omsInboundReceivingSkuDTOList && form.omsInboundReceivingSkuDTOList.length">
      <ex_header_spiler :title="$tt('label_sku_specification')">
        <template v-slot:left>
          <el-button @click="printSkuBarcode(form.omsInboundReceivingSkuDTOList)">{{ $tt('label_print_sku_only_code')
          }}</el-button>
        </template>
      </ex_header_spiler>
      <ex_super_table v-bind="skuTableOption" :data="form.omsInboundReceivingSkuDTOList" size="default" height="300" />
    </template>


    <ex_header_spiler :title="$tt('label_box_specification')">
      <template v-slot:left>
        <el-button @click="printBoxNo(form.omsBoxSkuInfoVOList)">{{ $tt('label_print_box_code') }}</el-button>
        <el-button @click="printSkuBarcode(form.omsBoxSkuInfoVOList)">{{ $tt('label_print_sku_only_code') }}</el-button>
      </template>
    </ex_header_spiler>
    <ex_super_table v-bind="tableOption" :data="form.omsBoxSkuInfoVOList" size="default" height="400" />
    <ex_header_spiler :title="$tt('label_operate_record')" />
    <ex_super_table v-bind="recordOption" :data="form.operateRecord" size="default" height="300" />
    <ex_header_spiler :title="$tt('label_receivable_accounts_details')" />
    <ex_super_table v-bind="billOption" :data="form.omsInboundBillDetailVOList ? form.omsInboundBillDetailVOList : []"
      size="default" height="300" />

    <ex_header_spiler :title="$tt('label_order_track')" />
    <ex_super_desc v-bind="trackOption" :data="form.omsInboundReceivingTrackVO ? form.omsInboundReceivingTrackVO : {}"
      :attrs="$defaultDetailDescAttrs" />
    <ex_super_table v-bind="trackListOption" height="300"
      :data="form.omsInboundReceivingTrackVO && form.omsInboundReceivingTrackVO.trackDetailList ? form.omsInboundReceivingTrackVO.trackDetailList : []"
      size="default" />

    <print_sku ref="print_sku" itemKey="skuId" />
    <print_box ref="print_box" />


  </div>
</template>
<script>




import router_params from '@/mixin/router_params';
import print_sku from '@/component/print/print_sku'
import print_box from '@/component/print/print_box'
export default {

  title: "title_inbound_order_detail",
  mixins: [router_params],
  components: { print_sku, print_box },


  data() {
    return {
      loading: false,

      form: {},
      baseOption: {
        model: [
          { key: 'receivingOrderCode', label: 'label_order_code', },
          // { key: 'customerCode', label: 'label_customer_info', },
          { key: 'status', label: 'label_order_status', formatter: (r, c, v, i) => this.$enumShow(v, "ReceivingOperationStatusEnum") },


          { key: 'customerName', label: 'label_customer_info', formatter: (r, c, v) => this.$formatNameCode(v, r.customerCode) },
          { key: 'inboundType', label: 'label_inbound_type', formatter: (r, c, v) => this.$enumShow(v, "InboundTypeEnum") },

          { key: 'bizType', label: 'label_business_type', formatter: (r, c, v) => this.$enumShow(v, "BizTypeEnum") },



          {
            key: 'destinationWarehouseName', label: 'label_destination_warehouse',
            formatter: (r, c, v) => this.$formatNameCode(v, r.destinationWarehouseCode)
          },


          { key: 'platformCode', label: 'label_platform_no', render: (h, { data, item }) => this.$renderText(h, data[item.key]) },
          {
            key: 'platformOrderNo', label: 'label_platform_reference_no',
            render: (h, { data, item }) => this.$renderText(h, data[item.key])
          },


          { key: 'description', label: 'label_remark', render: (h, { data, item }) => this.$renderText(h, data[item.key]) },

          { key: 'isPallet', label: 'label_has_pallet', formatter: (r, c, v) => this.$enumShow(v, "YesOrNoEnum") },
          { key: 'isCustomerPallet', label: 'label_has_customer_pallet', formatter: (r, c, v) => this.$enumShow(v, "YesOrNoEnum") },
          // { key: 'isWarehouseEdit', label: '是否仓库编辑', formatter: (r, c, v) => this.$enumShow(v, "YesOrNoEnum") },


          { key: 'expectBoxQty', label: 'label_expected_box_number', },
          { key: 'expectSkuQty', label: 'label_expected_sku_number', },

          {
            key: 'totalWeight', label: 'label_expected_total_weight', render: (h, { data, item }) => this.$renderText(h, this.$addUnitQuick.Weight(data[item.key])),
          },
          {
            key: 'totalVolume', label: 'label_expected_total_volume', render: (h, { data, item }) => this.$renderText(h, this.$addUnitQuick.Volume(data[item.key])),
          },
          {
            key: 'totalDensity', label: 'label_expected_total_density', render: (h, { data, item }) => this.$renderText(h, this.$addUnitQuick.Density(data[item.key])),
          },
          {
            key: 'measureOrderWeight', label: 'label_transit_measure_total_weight', render: (h, { data, item }) => this.$renderText(h, this.$addUnitQuick.Weight(data[item.key])),
          },
          {
            key: 'measureOrderVolume', label: 'label_transit_measure_total_volume', render: (h, { data, item }) => this.$renderText(h, this.$addUnitQuick.Volume(data[item.key])),
          },
          {
            key: 'measureOrderDensity', label: 'label_transit_measure_total_density', render: (h, { data, item }) => this.$renderText(h, this.$addUnitQuick.Density(data[item.key])),
          },
          {
            key: 'dataSources', label: 'label_data_source',
            formatter: (r, c, v) => this.$enumShow(v, "InboundDataSourcesEnum")
          },

          {
            key: 'boxDetailIsEmpty', label: 'label_require_sku_detail_manage',
            formatter: (r, c, v) => this.$enumShow(v, "YesOrNoOppositeEnum")
          },
          {
            key: 'boxIsEmpty', label: 'label_is_box_code_manage',
            formatter: (r, c, v) => this.$enumShow(v, "YesOrNoOppositeEnum")
          },
          // {
          //   key: 'inboundReason', label: 'label_inbound_reason',
          //   formatter: (r, c, v) => this.$enumShow(v, "InboundReasonEnum")
          // },

          { key: 'isWarehouseReceiptPrevail', label: 'label_isWarehouse_receipt_prevail', formatter: (r, c, v) => this.$enumShow(v, "YesOrNoEnum") },

          { key: 'creator', label: 'label_create_user', },
          { key: 'gmtCreate', label: 'label_create_time', formatter: (r, c, v, i) => this.$dateFormat(v) },
          { key: 'modifier', label: 'label_update_user', },
          { key: 'gmtModify', label: 'label_modify_time', formatter: (r, c, v, i) => this.$dateFormat(v) },

          {
            key: 'attachedDTOList', label: 'label_attachment_list', span: 2,
            render: (h, { data }) => {
              const item = data
              return (<ex_super_upload value={item.attachedDTOList} disabled type="file" />)
            }
          },
        ],
      },
      logisticsOption: {
        model: [
          { key: 'productName', label: 'label_logistics', formatter: (r, c, v) => this.$formatNameCode(v, r.productCode) },
          { key: 'deliveryType', label: 'label_delivery_type', if: () => this.inboundTypeTRANSIT, formatter: (r, c, v) => this.$enumShow(v, "DeliveryTypeEnum") },
          { key: 'deliveryMode', label: 'label_self_delivery_method', if: () => this.deliveryTypeDELIVERY, formatter: (r, c, v) => this.$enumShow(v, "DeliveryModeEnum") },
          {
            key: 'transitWarehouseName', label: 'label_transit_warehouse', if: () => this.inboundTypeTRANSIT,
            formatter: (r, c, v) => this.$formatNameCode(v, r.transitWarehouseCode)
          },
          {
            key: 'expectedDate', label: 'label_expected_arrival_date',
            render: (h, { data, item }) => this.$renderText(h, this.$dateFormat(data[item.key])),

          },

          {
            key: 'mainTrackingNumber', label: 'label_track_code', if: () => this.inboundTypeDIRECT,
            render: (h, { data, item }) => this.$renderText(h, data[item.key]),
          },

          { key: 'omsInboundReceivingAddressDTO.contacter', label: 'label_collect_person', if: () => this.deliveryTypeCOLLECT, },

          { key: 'omsInboundReceivingAddressDTO.contactPhone', label: 'label_collect_contact', if: () => this.deliveryTypeCOLLECT, },
          {
            key: 'omsInboundReceivingAddressDTO', label: 'label_collect_region', if: () => this.deliveryTypeCOLLECT,
            formatter: (r, c, v) => `${v.province} ${v.city} ${v.county}`
          },
          { key: 'omsInboundReceivingAddressDTO.street', label: 'label_collect_address', if: () => this.deliveryTypeCOLLECT, },

          { key: 'vehicleNo', label: 'label_self_delivery_car_code', if: () => this.deliveryModeSelfDelivery, },
          { key: 'driverName', label: 'label_self_delivery_driver_name', if: () => this.deliveryModeSelfDelivery, },
          { key: 'driverPhone', label: 'label_self_delivery_driver_phone', if: () => this.deliveryModeSelfDelivery, },

          {
            key: 'deliveryCompany', label: 'label_logistics_company', if: () => this.deliveryModeLogistics,
            render: (h, { data, item }) => this.$renderText(h, data[item.key]),
          },
          { key: 'deliveryTrackingNumber', label: 'label_logistics_track_code', if: () => this.deliveryModeLogistics, render: (h, { data, item }) => this.$renderText(h, data[item.key]), },
          { key: 'deliverySender', label: 'label_logistics_sender', if: () => this.deliveryModeLogistics, render: (h, { data, item }) => this.$renderText(h, data[item.key]), },
          { key: 'deliveryAddress', label: 'label_logistics_send_address', if: () => this.deliveryModeLogistics, render: (h, { data, item }) => this.$renderText(h, data[item.key]), },
        ],
      },
      serviceOption: {
        model: [
          { key: 'customsService', label: 'label_customs_service', formatter: (r, c, v) => this.$enumShow(v, "YesOrNoEnum") },
          { key: 'customsType', label: 'label_customs_type', formatter: (r, c, v) => this.$enumShow(v, "CustomsTypeEnum") },
          { key: 'isInsurance', label: 'label_insurance_server', formatter: (r, c, v) => this.$enumShow(v, "YesOrNoEnum") },
          { key: 'insuranceValue', label: 'label_insurance_amount', },
        ],
      },
      skuTableOption: {
        attrs: { stripe: true, },
        defaultColAttr: {
          align: 'left',
        },
        model: [

          // { key: 'skuBarcode', label: 'label_sku_code' },
          { key: 'skuName', label: 'label_sku_info', 'min-width': 120, 'show-overflow-tooltip': true, },
          {
            key: 'skuBarcode', label: 'label_sku_code', 'min-width': 120, 'show-overflow-tooltip': true,
            propertyFilter: true, sortable: true,
          },
          {
            key: 'skuOnlyCode', label: 'label_sku_only_code', 'min-width': 220,
            propertyFilter: true, sortable: true,

          },
          {
            key: 'skuDeclaredAmount', label: 'label_declared_value',
            sortable: true,
            formatter: (r, c, v) => this.$formatNameCode(v, r.currencyCode)
          },
          {
            key: 'insuredAmount', label: 'label_insurance_amount', 'min-width': 120,
            sortable: true,
            formatter: (r, c, v) => r.isInsurance == 'N' ? this.$tt('data_none') : this.$formatNameCode(v, r.currencyCode),
          },
          {
            key: 'quantity', label: 'label_inbound_count', 'min-width': 110,
            sortable: true,
          },
          {
            key: 'packingBoxQty', label: 'label_packbox_count', 'min-width': 110,
            sortable: true,
          },
        ],
      },
      tableOption: {
        attrs: { stripe: true, },
        defaultColAttr: {
          align: 'left',
        },
        model: [

          {
            key: 'palletNo', label: 'label_pallet_code', if: () => this.IsPALLET,
            propertyFilter: true, sortable: true,
            'show-overflow-tooltip': true,
          },
          {
            key: 'boxNo', label: 'label_box_code', 'width': 200,
            propertyFilter: true, sortable: true,

          },

          { key: 'skuName', label: 'label_sku_info', 'min-width': 120, 'show-overflow-tooltip': true, },
          {
            key: 'skuBarcode', label: 'label_sku_code', 'width': 120, 'show-overflow-tooltip': true,
            propertyFilter: true, sortable: true,
          },
          {
            key: 'skuOnlyCode', label: 'label_sku_only_code', 'width': 220,
            propertyFilter: true, sortable: true,

          },
          {
            key: 'skuDeclaredAmount', label: 'label_declared_value',
            sortable: true,
            formatter: (r, c, v) => this.$formatNameCode(v, r.currencyCode)
          },
          {
            key: 'insuredAmount', label: 'label_insurance_amount', 'min-width': 120,
            sortable: true,
            formatter: (r, c, v) => r.isInsurance == 'N' ? this.$tt('data_none') : this.$formatNameCode(v, r.currencyCode),
          },
          {
            key: 'quantity', label: 'label_create_order_number', 'width': 120,
            sortable: true,
          },

          {
            key: 'overseasReceivingStatus', label: 'label_receiving_status', 'width': 120, 'show-overflow-tooltip': true,
            formatter: (r, c, v) => this.$enumShow(v, 'ReceivingStatusEnum'),
          },
          {
            key: 'overseasReceivingQty', label: 'label_receiving_number', 'width': 120,
            sortable: true,
          },
          {
            key: 'overseasAcceptanceStatus', label: 'label_acceptance_status', 'width': 120, 'show-overflow-tooltip': true,
            formatter: (r, c, v) => this.$enumShow(v, 'AcceptanceStatusEnum'),
          },
          {
            key: 'overseasAcceptanceQty', label: 'label_acceptance_number', 'width': 120,
            sortable: true,
          },
          {
            key: 'overseasPutawayStatus', label: 'label_putaway_status', 'width': 120, 'show-overflow-tooltip': true,
            formatter: (r, c, v) => this.$enumShow(v, 'PutawayStatusEnum'),
          },
          {
            key: 'overseasPutawayQty', label: 'label_putaway_number', 'width': 120,
            sortable: true,
          },
          {
            label: 'label_box_dimension', 'width': 220, render: (h, { row }) => {
              const item = row
              if ([item.boxWeight, item.boxLength, item.boxWidth, item.boxHeight].every(it => !it)) return this.$tt('data_temp_none')
              return (<div>
                <div>{this.$tt("label_weight") + " : " + (this.$addUnitQuick.Weight(item.boxWeight))}</div>
                <div>{this.$tt("label_volume") + " : " + (this.$addUnitQuick.Volume(item.boxVolume))}</div>

                <div>{this.$tt("label_length") + " : " + (this.$addUnitQuick.Dimen(item.boxLength))}</div>
                <div>{this.$tt("label_width") + " : " + (this.$addUnitQuick.Dimen(item.boxWidth))}</div>
                <div>{this.$tt("label_height") + " : " + (this.$addUnitQuick.Dimen(item.boxHeight))}</div>
              </div>)
            }
          },
        ],
      },
      recordOption: {
        attrs: { stripe: true, },
        defaultColAttr: {
          align: 'left',
        },
        model: [
          {
            key: 'process', label: 'label_operate_process', 'min-width': 150, flxed: 'left',
            attrs: { formatter: (r, c, v, i) => this.$tt(v) }
          },
          {
            key: 'status', label: 'label_operate_status', 'min-width': 150, flxed: 'left',
            attrs: { formatter: (r, c, v, i) => r.statusText === undefined ? this.$enumShow(v, r.statusEnum) : r.statusText }
          },
          {
            key: 'planBoxCount', label: 'label_plan_box_number', width: 100,
          },
          { key: 'planSkuCount', label: 'label_plan_sku_number', width: 100, },
          {
            key: 'actualBoxCount', label: 'label_actual_box_number', width: 100,
            render: (h, { row, column }) => this.$renderText(h, row[column.property]),
            // formatter: (r, c, v, i) => r.run ? v : this.$tt("data_temp_none")
          },
          {
            key: 'actualSkuCount', label: 'label_actual_sku_number', width: 100,
            render: (h, { row, column }) => this.$renderText(h, row[column.property]),
            // formatter: (r, c, v, i) => r.run ? v : this.$tt("data_temp_none")
          },
          {
            key: 'operateUser', label: 'label_operate_user', 'min-width': 140,
            render: (h, { row, column }) => this.$renderText(h, row[column.property]),
            // formatter: (r, c, v, i) => r.run ? v : this.$tt("data_temp_none")
          },
          {
            key: 'operateTime', label: 'label_operate_time', 'width': 150,
            render: (h, { row, column }) => this.$renderText(h, this.$dateFormat(row[column.property])),
            // formatter: (r, c, v, i) => r.run ? this.$dateFormat(v) : this.$tt("data_temp_none")
          },

        ],
      },
      billOption: {
        attrs: { stripe: true, },
        defaultColAttr: {
          align: 'left',
        },
        model: [
          {
            key: 'productName', label: 'label_logistics', 'min-width': 200,
            render: (h, { row, column }) => this.$renderText(h, this.$formatNameCode(row[column.property], row.productCode)),
          },
          { key: 'serviceName', label: 'label_pms_service_cost', 'min-width': 160, render: (h, { row, column }) => this.$renderText(h, row[column.property]), },

          { key: 'price', label: 'label_calculate_unit_price', 'width': 140, render: (h, { row, column }) => this.$renderText(h, this.$addUnit(row[column.property], row.currencyType)), },
          { key: 'calNums', label: 'label_calculate_count', 'width': 120, render: (h, { row, column }) => this.$renderText(h, row[column.property]), },
          { key: 'serviceAmount', label: 'label_money', 'width': 140, render: (h, { row, column }) => this.$renderText(h, this.$addUnit(row[column.property], row.currencyType)), },
          { key: 'status', label: 'label_settlement_situation', 'width': 150, render: (h, { row, column }) => this.$renderText(h, this.$enumShow(row[column.property], 'FmsBillDetailStatus')), },

        ]
      },
      trackOption: {
        model: [
          { key: 'trackNo', label: 'label_track_code', formatter: (r, c, v, i) => v || this.$tt("data_temp_none") },
        ],
      },
      trackListOption: {
        attrs: { stripe: true, },
        defaultColAttr: {
          align: 'left',
        },
        model: [
          { key: 'trackTime', label: 'label_time', width: 200, render: (h, { row, column }) => this.$renderText(h, this.$dateFormat(row[column.property])), },
          { key: 'trackDesc', label: 'label_track_info', 'min-width': 200, render: (h, { row, column }) => this.$renderText(h, row[column.property]), },
        ]
      },
    };
  },

  computed: {
    IsPALLET() {
      return this.form.isPallet == "Y"
    },
    TOB() {
      return this.form.bizType == 'TOB'
    },
    activeStatus() {
      if (this.form.outStatus == 'COMPLETED') {
        return 5
      } else if (this.form.outStatus == 'COMPLETE_OUTBOUND') {
        return 4
      } else if (this.form.outStatus == 'WAREHOUSE_PROCESSING') {
        return 3
      } else if (this.form.submitDate) {
        return 2
      }
      return 1
    },
    inboundTypeTRANSIT() {
      return this.form.inboundType == 'TRANSIT'
    },
    inboundTypeDIRECT() {
      return this.form.inboundType == 'DIRECT'
    },
    //交货方式-揽收
    deliveryTypeCOLLECT() {
      return this.inboundTypeTRANSIT && this.form.deliveryType == 'COLLECT'
    },
    deliveryTypeDELIVERY() {
      return this.inboundTypeTRANSIT && this.form.deliveryType == 'DELIVERY'
    },

    deliveryModeSelfDelivery() {
      return this.deliveryTypeDELIVERY && this.form.deliveryMode == 'DELIVERY'
    },
    deliveryModeLogistics() {
      return this.deliveryTypeDELIVERY && this.form.deliveryMode == 'LOGISTICS'
    },
  },
  methods: {
    printBoxNo(list) {
      if (_.isEmpty(list)) return this.$message.error(this.$tt('tip_please_add_least_one_box'))
      const boxNo_group = _.groupBy(list, it => it.boxId)
      const printData = []
      _.forOwn(boxNo_group, (value, k) => {
        printData.push(
          {
            orderId: this.form.id,
            boxId: k,
            binNo: _.head(value).boxNo,
            // orderNo: this.form.receivingOrderCode,
            // binCount: Object.keys(boxNo_group).length,
            targetWarehouse: this.form.destinationWarehouseName,
            customerCode: this.form.customerCode,
            skuCategoryNum: _.uniqBy(value, sku => sku.skuId).length,
            skuCount: _.reduce(value, (r, v) => this.$math_add(r, (v.quantity)), 0),
            // binWeight: _.head(value).boxWeight,
            // boxNumber: _.head(value).boxNumber,
            // skuOnlyCodeNumMap: value.map(it => `${it.skuOnlyCode} * ${it.quantity}`).join(" , ")
          }
        )
      })
      this.$refs.print_box.show(printData)
    },
    printSkuBarcode(list) {
      if (_.isEmpty(list)) return this.$message.error(this.$tt('tip_please_add_least_one_sku'))
      this.$refs.print_sku.show(_.uniqBy(list, it => it.skuId))
    },
    init_data_default(into_params) {
      if (into_params.receivingId) {
        this.loading = true
        this.$ajax({
          url: "/oms-api/receiving/InboundReceivingRpc/selectByReceivingId.json",
          method: 'post',
          data: { receivingId: into_params.receivingId },
          success: (res) => {
            this.loading = false
            this.form = Object.assign({}, res.data)
            this.fixTabLabel()

            const run_transfer_acceptance = this.form.acceptanceStatus != 'NOT_ACCEPTANCE'

            const run_overseas_acceptance = this.form.overseasAcceptanceStatus != 'NOT_ACCEPTANCE'
            const orderOption = [
              {
                process: "label_create_order",
                statusText: this.$t('label_success'),
                run: !!this.form.gmtCreate,
                planBoxCount: this.form.expectBoxQty, planSkuCount: this.form.expectSkuQty,
                actualBoxCount: this.form.expectBoxQty, actualSkuCount: this.form.expectSkuQty,
                operateUser: this.form.creator,
                operateTime: this.form.gmtCreate,
              },
            ]
            const transferOption = [
              {
                process: "title_transfer_receiving",
                status: this.form.receivingStatus,
                statusEnum: "ReceivingStatusEnum",
                run: this.form.receivingStatus != 'NOT_RECEIVING',
                planBoxCount: this.form.expectBoxQty, planSkuCount: this.form.expectSkuQty,
                actualBoxCount: this.form.receivingBoxQty, actualSkuCount: this.form.receivingSkuQty,
                operateUser: this.$formatNameCode(this.form.receivingUserName, this.form.receivingUserCode, ""),
                operateTime: this.form.receivingTime,
              },
              {
                process: "title_transfer_check",
                status: this.form.acceptanceStatus,
                statusEnum: "AcceptanceStatusEnum",
                run: run_transfer_acceptance,
                planBoxCount: this.form.receivingBoxQty, planSkuCount: this.form.receivingSkuQty,
                actualBoxCount: this.form.acceptanceBoxQty, actualSkuCount: this.form.acceptanceSkuQty,
                operateUser: this.$formatNameCode(this.form.acceptanceUserName, this.form.acceptanceUserCode, ""),

                operateTime: this.form.acceptanceTime,
              },
              {
                process: "title_transfer_pack",
                status: this.form.packingStatus,
                statusEnum: "PackingStatusEnum",
                run: this.form.packingStatus != 'NOT_PACKING',
                planBoxCount: this.form.receivingBoxQty,
                planSkuCount: this.form.receivingSkuQty,
                actualBoxCount: this.form.packingBoxQty, actualSkuCount: this.form.packingSkuQty,
                operateUser: this.$formatNameCode(this.form.packingUserName, this.form.packingUserCode, ""),
                operateTime: this.form.packingTime,
              },
              {
                process: "title_transfer_checkout", status: this.form.checkoutStatus,
                statusEnum: "CheckoutStatusEnum",
                run: this.form.checkoutStatus != 'NOT_CHECKOUT',
                planBoxCount: this.form.expectCheckoutBoxQty,
                planSkuCount: this.form.expectCheckoutSkuQty,
                actualBoxCount: this.form.checkoutBoxQty, actualSkuCount: this.form.checkoutSkuQty,
                operateUser: this.$formatNameCode(this.form.checkoutUserName, this.form.checkoutUserCode, ""),
                operateTime: this.form.checkoutTime,
              },
            ]
            const standardOption = [

              {
                process: "title_standard_receiving", status: this.form.overseasReceivingStatus,
                statusEnum: "ReceivingStatusEnum",
                run: this.form.overseasReceivingStatus != 'NOT_RECEIVING',
                planBoxCount: this.inboundTypeTRANSIT ? this.form.checkoutBoxQty : this.form.expectBoxQty,
                planSkuCount: this.inboundTypeTRANSIT ? this.form.checkoutSkuQty : this.form.expectSkuQty,
                actualBoxCount: this.form.overseasReceivingBoxQty, actualSkuCount: this.form.overseasReceivingSkuQty,
                operateUser: this.$formatNameCode(this.form.overseasReceivingUserName, this.form.overseasReceivingUserCode, ""),
                operateTime: this.form.overseasReceivingTime,
              },
              {
                process: "title_standard_check", status: this.form.overseasAcceptanceStatus,
                statusEnum: "AcceptanceStatusEnum",
                run: run_overseas_acceptance,
                planBoxCount: this.form.overseasReceivingBoxQty,
                planSkuCount: this.form.overseasReceivingSkuQty,
                actualBoxCount: this.form.overseasAcceptanceBoxQty, actualSkuCount: this.form.overseasAcceptanceSkuQty,
                operateUser: this.$formatNameCode(this.form.overseasAcceptanceUserName, this.form.overseasAcceptanceUserCode, ""),
                operateTime: this.form.overseasAcceptanceTime,
              },
              {
                process: "title_standard_putaway", status: this.form.overseasPutawayStatus,
                statusEnum: "PutawayStatusEnum",
                run: this.form.overseasPutawayStatus != 'NOT_PUTAWAY',
                planBoxCount: this.form.overseasExpectPutawayBoxQty,
                planSkuCount: this.form.overseasExpectPutawaySkuQty,
                actualBoxCount: this.form.overseasPutawayBoxQty, actualSkuCount: this.form.overseasPutawaySkuQty,
                operateUser: this.$formatNameCode(this.form.overseasPutawayUserName, this.form.overseasPutawayUserCode, ""),
                operateTime: this.form.overseasPutawayTime,
              },
            ]
            this.form.operateRecord = [
              ...orderOption,
              ...(this.inboundTypeTRANSIT ? transferOption : []),
              ...standardOption
            ]

          }
        })
      }
      this.fixTabLabel()
    },
    fixTabLabel() {
      if (!!this.form.receivingOrderCode) {
        this.$emit("tagModifyLabel", { _key: 'label_name_code', name: this.$tt('title_inbound_order_detail'), code: this.form.receivingOrderCode || '' })

      } else {
        this.$emit("tagModifyLabel", "title_inbound_order_detail")
      }
    },
  }
};

</script>
<style></style>
